<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns="http://www.w3.org/1999/xhtml"
                template="./../home.xhtml"
                xmlns:h="http://xmlns.jcp.org/jsf/html"
                xmlns:p="http://primefaces.org/ui"
                xmlns:f="http://xmlns.jcp.org/jsf/core"
                xmlns:pe="http://primefaces.org/ui/extensions">

    <ui:define name="content">
        <div class="col-lg-12">
            <h3 class="page-header" id="comercio">
                Administracion de Vehiculos
                <h:link value="Regresar a Listado" outcome="list.xhtml" styleClass="pull-right" style="font-size: 16px; margin-right: 30px;"  />
            </h3>
        </div>
        <div class="row">
            <div class="col-lg-12">
                <div class="panel panel-primary">
                    <div class="panel-heading" style="font-weight: bold;">Registro de Vehiculos</div>
                    <div class="panel-body">
                        <h:form id="frmRegistrarMarca" styleClass="form-horizontal" >

                            <f:event type="preRenderView" listener="#{vehiculoControlador.initRegistrar()}" />
                            <h:messages globalOnly="true" styleClass="list-group" infoClass="list-group-item list-group-item-success"
                                        errorClass="list-group-item list-group-item-danger"  />
                            <div class="form-group has-feedback">
                                <label for="marca" class="col-sm-3 control-label" >Marca :</label>
                                <div class="col-sm-5">
                                    <p:inputText styleClass="form-control" id="marca" value="#{vehiculoControlador.vehiculo.marca}"  />
                                </div>	
                            </div>
                            <div class="form-group has-feedback">
                                <label for="modelo" class="col-sm-3 control-label" >Modelo :</label>
                                <div class="col-sm-5">
                                    <p:inputText styleClass="form-control" id="modelo" value="#{vehiculoControlador.vehiculo.modelo}"  />
                                </div>
                            </div>
                            <div class="form-group has-feedback">
                                <label for="carga" class="col-sm-3 control-label" >Carga :</label>
                                <div class="col-sm-5">
                                    <p:inputText styleClass="form-control" id="carga" value="#{vehiculoControlador.vehiculo.carga}"  />
                                </div>
                            </div>                                   
                            <div class="form-group has-feedback">
                                <label for="matricula" class="col-sm-3 control-label" >Matricula :</label>
                                <div class="col-sm-8">
                                    <p:inputText styleClass="form-control" id="matricula" value="#{vehiculoControlador.vehiculo.matricula}"  />
                                </div> 
                            </div>
                            <p:commandButton value="Guardar" actionListener="#{vehiculoControlador.registrar()}" update="@form" styleClass="btn btn-primary"/>
                        </h:form>
                    </div>
                </div>
            </div>
        </div>
    </ui:define>

</ui:composition>
